<?php

namespace App\Http\Controllers\Api;

use App\Http\Controllers\Controller;
use App\Rep\MaterialRetreatLogRep;
use Illuminate\Http\Request;

class MaterialRetreatLog extends Controller
{
    //
    protected $rep;

    public function __construct(Request $request)
    {
        $this->rep = new MaterialRetreatLogRep();
    }

    public function getMaterialRetreatLogList(Request $request)
    {
        $params = $request->only([]);
        $data = $this->rep->getMaterialRetreatLogListRep($params);
        return re(0,$data,'success');
    }

    public function createMaterialRetreatLog(Request $request){
        $params = $request->only(['field','field_value','employee_user_id','job_type_id','material_id','num','retreat_time']);
        $data = $this->rep->createMaterialRetreatLogRep($params);
        return re($data['code'],$data['data'],$data['msg']);
    }
}
